




//
//  OutModel.m
//  FM
//
//  Created by MB__Lee on 2018/4/9.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "OutModel.h"




@implementation OutModel
+(JSONKeyMapper *)keyMapper{
    
    return  [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{@"OutID":@"id"}];
    
}
+(BOOL)propertyIsOptional:(NSString *)propertyName{
    return  YES;
}

-(void)caculateCellNumAndCellHeight{
    [self caculateCellNum]; //计算cell 总数 和高度
    
}

-(void)caculateCellNum{
    
//    NSUInteger num = 2; //works 必须一行显示 + 每段段头必须有tableHeaderView
    NSUInteger num = 1;//works 必须一行显示 + 每段必须有tableHeaderView ，但是第一段段头不显示，因此用1，同时修改sectionHeader 高度
    for (MiddleModel *model in self.accessories ) {
        num += model.accessory.count;
    }
    num +=self.accessories.count;

    
    
    
    self.cellNum = num;
    
    self.cellHeight = self.cellNum * Cell_Height;
    
}




@end
